#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>

void fun(int* a, int n) {
	int i, j, k, t;
	for (i = 0; i < n - 1; i += 2) {
		k = i;
		for (j = 1; j < n; j += 2)
			if (a[j] > a[k]) {
				k = j;
				t = a[i];
				a[i] = a[k];
				a[k] = t;
			}
	}
}

void main(){
	int aa[10] = { 1, 2, 3, 4, 5, 6, 7 }, a;
		fun(aa, 7);
		for (int i = 0; i < 7; i++)
			printf("%d, ", aa[i]);
		printf("\n");
}
